/**
 * 
 */
package javapop.framework.generic;

import javapop.framework.generic.tool.GrammarVisitor;
import javapop.utils.Triple;

/**
 * @author Hakim
 *
 */
public class GExprBracket implements GrammarTree {

	private String parser;
	private String open;
	private String close;
	
	/**
	 * @param content 
	 * 
	 */
	public GExprBracket(Triple<String, String, String> content) {
		parser = content.getFirst();
		open = content.getSecond();
		close = content.getThird();
	}


	@Override
	public <T,R,E extends Exception> T visit(GrammarVisitor<T,R, E> g) throws E {
		return g.visit(this);
	}


	/**
	 * @return the parser
	 */
	public String getParser() {
		return parser;
	}


	/**
	 * @return the open
	 */
	public String getOpen() {
		return open;
	}


	/**
	 * @return the close
	 */
	public String getClose() {
		return close;
	}

	@Override
	public String toString() {
		StringBuilder sb = new StringBuilder("@expr_bracket(");
		sb.append(parser);
		sb.append(",\"");
		sb.append(open);
		sb.append("\",");
		sb.append("\"");
		sb.append(close);
		sb.append("\");");
		return sb.toString();
	}
}
